class early_stop(object):
    '''
    return best_score, step_release
    '''

    def __init__(self, num_early_stop=10):
        self.num_early_stop = num_early_stop
        self.best_score = 0
        self.step_release = num_early_stop

    def __call__(self, score):
        if score > self.best_score:
            self.best_score = score
            self.step_release = self.num_early_stop
        else:
            self.step_release -= 1

        return self.best_score, self.step_release